package com.tous.modules.bean;

/**
 * @author mengwei
 * @description 消息接收
 * @createDate 2025/7/19 14:24
 */
public class UdpMessage {

    private Long messageId;

    private String content;

    private Integer needAck;

    private Long timestamp;

    public Long getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getNeedAck() {
        return needAck;
    }

    public void setNeedAck(Integer needAck) {
        this.needAck = needAck;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public UdpMessage(Long messageId, String content, Integer needAck, Long timestamp) {
        this.messageId = messageId;
        this.content = content;
        this.needAck = needAck;
        this.timestamp = timestamp;
    }

    public static UdpMessage error() {
        return new UdpMessage(1L, "发生异常", 1, System.currentTimeMillis());
    }
}
